<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="favicon.ico">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<title>金融管理系统登录</title>
<style type="text/css">
.login-box-body{
	margin-left:200px; 
		width: 400px;
	margin-top: 400px;
	
}
.login-page{
height: 55%;
}
</style>
<link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css" />

<script src="../bootstrap/js/bootstrap.min.js"></script>
<!-- Font Awesome -->
<link rel="stylesheet" href="../assets/fonts/awesome/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="../assets/fonts/ionicon/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="../dist/css/AdminLTE.css">
<!-- iCheck -->
<link rel="stylesheet" href="../plugins/iCheck/square/blue.css">
</head>
<body class="hold-transition login-page" style="background: url(../login/jrgw_login.jpg) #f8f6e9 no-repeat fixed center;">
	<div class="login-box">
		<!-- <div class="login-logo">
			<span style="color: yellow"><b>账号登录</b></span>
		</div> -->
		<div class="login-box-body">
			<p class="login-box-msg"></p>
			<form action="#" method="post">
				<div class="form-group has-feedback">
					<input type="text" id="cname" class="form-control" placeholder="请输入账号" maxlength="20" required autofocus> <span class="glyphicon glyphicon-user form-control-feedback"></span>
				</div>
				<div class="form-group has-feedback">
					<input type="password" id="cpassword" class="form-control" placeholder="请输入密码" maxlength="20" required autofocus> <span class="glyphicon glyphicon-lock form-control-feedback"></span>
				</div>
				<div class="row">
					<div class="col-xs-8">
						<div class="checkbox icheck">
							<label>
								<input type="checkbox"> 记住密码
							</label>
						</div>
					</div>
					<div class="col-xs-4">
						<button type="button" class="btn btn-primary btn-block btn-flat" onclick="severCheck()">登录</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</body>
<!-- jQuery 2.2.3 -->
<script src="../plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="../bootstrap/js/bootstrap.min.js"></script>
<!-- iCheck -->
<script src="../plugins/iCheck/icheck.min.js"></script>
<script>
	$(function() {
		$('input').iCheck({
			checkboxClass : 'icheckbox_square-blue',
			radioClass : 'iradio_square-blue',
			increaseArea : '20%' // optional
		});
	});
	document.onkeydown=function(event){
	    var e = event || window.event || arguments.callee.caller.arguments[0];
	     if(e && e.keyCode==13){ // enter 键
	    	 severCheck();
	    }
	};
	
	 function severCheck() {
	   var cname = $("#cname").val();
	  var cpassword =$("#cpassword").val();
	   $.ajax({
                    type : "post",
                    url : "../login/checkLogin",
                    data : {
                        cname : cname,
                        cpassword : cpassword
                    },
                     dataType : "json",
                    cache : false,
                     success : function(data) {
                     if(data.success){
                    	 window.location.href = "../main/index";
                     }else{
                     	alert(data.msg);
                     }
                     }
                     
                      });
	 }	
</script>
</html>